package com.usian.mapper;

//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usian.pojo.User;
import org.apache.ibatis.annotations.*;
import tk.mybatis.mapper.common.Mapper;


import java.util.List;

public interface UserMapper extends Mapper<User> {
    public List<User> findAll();

    @Select("select * from user where userName=#{user.userName} and password=#{user.password}")
    public List<User> findUser(@Param("user") User user);
//    @Insert(" insert into user(userName,password,userType,roleId,userDescription,inputDate)\n" +
//            "         values(#{userName},#{password},#{userType},#{roleId},#{userDescription},#{inputDate})")
    public void addUser(User user);
    @Delete("delete from user where userId=#{id}")
    void del(Integer id);
    @Select("select * from user where userId=#{id}")
    User editId(Integer integer);
    @Update("update user set userName=#{userName},password=#{password},userType=#{userType},roleId=#{roleId},userDescription=#{userDescription},inputDate=#{inputDate} where userId=#{userId}")
    void editUser(User user);
}
